﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DLINQ(LINQ to SQL)之面向对象的添加、查询、更新和删除.aspx.cs" Inherits="_35newpart_Linq_DLINQ_LINQ_to_SQL_之面向对象的添加_查询_更新和删除" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>
                    <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    分类名称：<asp:TextBox ID="txtCategoryName" runat="server"></asp:TextBox>
                    &nbsp;&nbsp; 分类描述：<asp:TextBox ID="txtDescription" runat="server"></asp:TextBox>
                    &nbsp;&nbsp;
                    <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="添加" />
                </ContentTemplate>
            </asp:UpdatePanel>

            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                </ContentTemplate>
            </asp:UpdatePanel>
    </p>

    
    <br />

        <p>              <asp:GridView ID="gvCategory" runat="server" DataKeyNames="ClaId" 
                        onselectedindexchanged="gvCategory_SelectedIndexChanged" 
                PageSize=3 onrowcancelingedit="gvCategory_RowCancelingEdit" 
                onrowdeleting="gvCategory_RowDeleting" onrowediting="gvCategory_RowEditing" 
                onrowupdating="gvCategory_RowUpdating">
                        <columns>
                            <asp:commandfield ShowDeleteButton="true" ShowEditButton="true" 
                                ShowSelectButton="true" />
                        </columns>
                    </asp:GridView>
                    
            &nbsp;</p>
            <p>
                        更新数据
                        <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" 
                            onmodechanging="DetailsView1_ModeChanging" Width="125px" 
                            onitemupdating="DetailsView1_ItemUpdating">
                            <fields>
                                <asp:commandfield ShowEditButton="True"></asp:commandfield>
                            </fields>
                        </asp:DetailsView>
                    </p>
    </div>
    </form>
</body>
</html>
